package com.roncoo.education.course.service.feign;

import com.alibaba.fastjson.JSON;
import com.roncoo.education.course.feign.interfaces.IFeignAdv;
import com.roncoo.education.course.feign.interfaces.IFeignTag;
import com.roncoo.education.course.feign.qo.AdvQO;
import com.roncoo.education.course.feign.qo.TagQO;
import com.roncoo.education.course.feign.vo.AdvVO;
import com.roncoo.education.course.feign.vo.TagVo;
import com.roncoo.education.course.feign.vo.UserTagNameVO;
import com.roncoo.education.course.service.feign.biz.FeignAdvBiz;
import com.roncoo.education.course.service.feign.biz.FeignTagBiz;
import com.roncoo.education.util.base.BaseController;
import com.roncoo.education.util.base.Page;

import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * 广告信息
 *
 * @author wujing
 */
@RestController
public class FeignTagController extends BaseController implements IFeignTag {

    @Autowired
    private FeignTagBiz biz;


    @Override
    public Long save(@RequestBody TagQO qo) {
        return biz.save(qo);
    }

    @Override
    public int updateById(@RequestBody TagQO qo) {
        return biz.updateById(qo);
    }

    @Override
    public int deleteById(@PathVariable(value = "id") Long id) {
        return biz.deleteById(id);
    }

    @Override
	public List<TagVo> findByTag() {
		return biz.findByTag();
	}

    @Override
    public ArrayList<UserTagNameVO> userNoByTagId(String tagids) {
        List<Long> tagIdList = (List<Long>) JSON.parse(tagids);
        return biz.userNoByTagId(tagIdList);
    }

}
